//
//  AXMyWdjsSchemeDetailsSevenCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/8.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXMyWdjsSchemeDetailsSevenCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "UITableView+SDAutoTableViewCellHeight.h"

@implementation AXMyWdjsSchemeDetailsSevenCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    self.bgView = [[UIView alloc]init];
    self.bgView.cornerRadius = 5;
    self.bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.bgView];
    
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    self.titleLabel.text = @"缺素症及施肥方案";
    self.titleLabel.font = FONT_FOURTEEN;
    self.titleLabel.textColor = COLOR_DIV;
    [self.bgView addSubview:self.titleLabel];
    
    self.contentLabel1 = [[UILabel alloc]init];
    self.contentLabel1.font = FONT_FOURTEEN;
    self.contentLabel1.textColor = COLOR_Gray;
    [self.bgView addSubview:self.contentLabel1];
    
    self.contentLabel2 = [[UILabel alloc]init];
    self.contentLabel2.font = FONT_FOURTEEN;
    self.contentLabel2.textColor = COLOR_Gray;
    [self.bgView addSubview:self.contentLabel2];
    
    self.contentLabel3 = [[UILabel alloc]init];
    self.contentLabel3.font = FONT_FOURTEEN;
    self.contentLabel3.textColor = COLOR_Gray;
    [self.bgView addSubview:self.contentLabel3];
    
    self.contentLabel4=[[UILabel alloc]init];
    self.contentLabel4.font=FONT_FOURTEEN;
    self.contentLabel4.textColor=COLOR_Gray;
    [self.bgView addSubview:self.contentLabel4];
    
    
    self.contentLabel5 = [[UILabel alloc]init];
    self.contentLabel5.font = FONT_FOURTEEN;
    self.contentLabel5.textColor =COLOR_Gray;
    [self.bgView addSubview:self.contentLabel5];
    
    
    
    
    
    
}

- (void)setlayout {
    
    self.bgView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 5)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(130);
    
    self.titleLabel.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.bgView, 10)
    .widthIs(SCREEN_WIDTH-40)
    .heightIs(20);
    
    self.contentLabel1.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.titleLabel, 10)
    .widthIs((SCREEN_WIDTH-20-30)/2)
    .heightIs(20);
    
    self.contentLabel2.sd_layout
    .rightSpaceToView(self.bgView, 10)
    .topEqualToView(self.contentLabel1)
    .widthRatioToView(self.contentLabel1, 1)
    .heightRatioToView(self.contentLabel1, 1);
    
    
    self.contentLabel3.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.contentLabel1, 10)
    .widthRatioToView(self.contentLabel1, 1)
    .heightRatioToView(self.contentLabel1, 1);
    
    self.contentLabel4.sd_layout
    .rightSpaceToView(self.bgView, 10)
    .topEqualToView(self.contentLabel3)
    .widthRatioToView(self.contentLabel3, 1)
    .heightRatioToView(self.contentLabel3, 1);
    
    
    self.contentLabel5.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.contentLabel3, 10)
    .widthRatioToView(self.contentLabel1, 1)
    .heightRatioToView(self.contentLabel1, 1);
    
    
    
    [self setupAutoHeightWithBottomView:self.bgView bottomMargin:10];
    
    
}

-(void) setModel:(DeficiencyFertilizerModel *)model{
    _model=model;
    _contentLabel1.text=[NSString stringWithFormat:@"缺素症：%@",_model.fertilizerPreventionObject];
    _contentLabel2.text=[NSString stringWithFormat:@"肥料名称：%@",_model.fertilizerProductGneral];
    _contentLabel3.text=[NSString stringWithFormat:@"亩用量(kg)：%@",_model.fDeficiencyFertilizerDosage];
    _contentLabel4.text=[NSString stringWithFormat:@"施用方法：%@",_model.fDeficiencyFertilizerMethodCHS];
    _contentLabel5.text=[NSString stringWithFormat:@"施肥补充说明：%@",_model.fDeficiencyFertilizerInstructions];
}


@end
